package tree;

import visitor.IRTreePrint;


public class MOVE extends tree.Exp {
  public Exp dst, src;
  public MOVE(tree.Exp d, tree.Exp s) {dst=d; src=s;}
  public ExpList kids() {
        if (dst instanceof MEM)
	   return new ExpList(((MEM)dst).exp, new ExpList(src,null));
	else return new ExpList(src,null);
  }
  public Stm build(ExpList kids) {
        if (dst instanceof MEM)
	   return new MOVE(new MEM((Exp) kids.head), (Exp) kids.tail.head);
	else return new MOVE(dst, (Exp) kids.head);
  }
  
  public void accept(IRTreePrint v){
		v.visit(this);
	}
}

